package com.shujia.day05;

public class Demo10Emp {
    public static void main(String[] args) {
        Emp emp = new Emp("马未龙", 10, 1);
        emp.working("鼎盛科技","JAVA开发工程师");
//        emp.show();
//        System.out.println(10%3.0);
        
    }
}

class Emp {
    //    2.。设定属性包括：姓名，年龄， 技术方向，工作年限, 工作单位和职务；方法包括：工作
    private String name;
    private int age;
    private String kill;
    private int year;
    private String dept;
    private String job;

    public Emp(String name, int age,  int year) {
        this.name = name;
        this.age = age;
        this.year = year;

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age > 15){
            this.age = age;
        }else {
            System.out.println("IT工作人员必须大于15");
            this.age = 15;
        }

    }

    public String getKill() {
        return kill;
    }


    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public void working( String dept, String job){
        this.dept = dept;
        this.job = job;
        if (job.equals("JAVA开发工程师")){
            this.kill = "JAVA开发";
        }
        if (job.equals("数据库维护工程师")){
            this.kill = "数据库维护";
        }
        show();
    }
    private void show(){
        System.out.println("姓名:"+name);
        System.out.println("年龄:"+age);
        System.out.println("技术方向:"+this.kill);
        System.out.println("工作年限:"+year);
        System.out.println(dept);
        System.out.println(job);
    }
}